<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <title>component basic</title>
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  <meta name="description" content="" />
  <meta name="keywords" content="" />
  <link href="" rel="stylesheet" />
</head>

<body>
  <div id="root">
    <my-header></my-header>
    <my-footer></my-footer>
    <my-footer></my-footer>
  </div>
  <script src="../vue.js"></script>
  <script>
    /*
      第一种：Vue...

      第二种：const...
    */
    Vue.component('my-header', {
      template: `
       <header>line 1</header> 
      `
    })
    const myFooter = {
      template: `
        <footer>line 2</footer>
      `,
      data() {
        return {
          x: 'line 2'
        }
      },
    }
    var vm = new Vue({
      el: "#root",
      data: {

      },
      components: {
        'my-footer': myFooter
      }
    })
    // 去掉run...提示
    Vue.config.productionTip = false
  </script>
</body>

</html>